using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace ShopForWeb.Models.Basic
{
  /// <summary>
  /// Order
  /// </summary>
  [Table("T_Order")]
  public partial class Order
  {
    /// <summary>
    /// 地点
    /// </summary>
    [StringLength(50)]
    public string Address { get; set; } = "";

    /// <summary>
    /// 管理员ID，外键，自增
    /// </summary>
    public long AdminId { get; set; }

    [ForeignKey("AdminId")]
    public virtual Admin CorAdmin { get; set; } = null!;

    /// <summary>
    /// 订单ID，主键，GUID
    /// </summary>
    [Key]
    public string OrderId { get; set; } = "";

    /// <summary>
    /// 订单状态
    /// </summary>
    [StringLength(50)]
    public string OrderState { get; set; } = "";

    /// <summary>
    /// 下单时间
    /// </summary>
    [StringLength(20)]
    public string OrderTime { get; set; } = "";

    /// <summary>
    /// 收货电话
    /// </summary>
    [StringLength(11)]
    public string Phone { get; set; } = "";

    /// <summary>
    /// 总价格
    /// </summary>
    [Column(TypeName = "decimal(18,2)")]
    public decimal TotalPrice { get; set; }

    /// <summary>
    /// 用户ID，外键，自增
    /// </summary>
    public long UserId { get; set; }

    [ForeignKey("UserId")]
    public virtual User CorUser { get; set; } = null!;
  }
}
